from yawSrc.tools.getPlotly import get2dFig, get2dFig, get2dFig_com
from yawSrc.tools.loadFile import toLineRegressCsv, toAttrCsv, toLineRegressAttrCsv, toLineCompareAttrCsv_Yaw
import pandas as pd
from common.config import yawConfig as Config
from toolsSrc.files.loadFiles import readLineCsvSetLegend


'''
对比两条曲线
'''
def lineCompareProcess():
    print('lineCompareProcess 进行中................')
    # 1. 两个曲线文件合并成一个文件，并用图例区分
    X = readLineCsvSetLegend(Config.hisLineRegress, '历史曲线')
    X = pd.concat([X, readLineCsvSetLegend(Config.onlLineRegress, '在线优化曲线')])
    X = pd.DataFrame(X, columns=[Config.WindDirection, Config.WindSpeed, '图例'])
    X.to_csv(Config.lineCompareProcess, index=False)

    # 2. 生成属性文件
    toLineCompareAttrCsv_Yaw(Config.lineCompareProcess, Config.lineCompareAttr)
    print('lineCompareProcess 结束................')

if __name__ == '__main__':
    lineCompareProcess()








